package org.example.utils;

//import org.example.entity.BaseEntity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @date 2022/12/5
 * @description 返回成功的map
 */
public class Result {

    private static final String SUCCESS_MSG = "成功";
    
    private static Integer SUCCESS_CODE = 200;
    
    private static final String FAIL_MSG = "失败";
    
    private static Integer FAIL_CODE = 500;



    public static Map<String,Object> fileMap(){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",FAIL_MSG);
        map.put("code",FAIL_CODE);
        return map;
    }

    public static Map<String,Object> fileMap(String msg){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",FAIL_CODE);
        return map;
    }

    public static Map<String,Object> fileMap(Integer code){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",FAIL_MSG);
        map.put("code",code);
        return map;
    }

    public static Map<String,Object> fileMap(String msg,Integer code){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",code);
        return map;
    }

    public static Map<String,Object> fileMap(Map<String,Object> data) {
        Map<String,Object> map = new HashMap<>();
        map.put("msg",FAIL_MSG);
        map.put("code",FAIL_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",SUCCESS_CODE);
        return map;
    }

    public static Map<String,Object> successMap(String msg){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",SUCCESS_CODE);
        return map;
    }

    public static Map<String,Object> successMap(Integer code){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",code);
        return map;
    }

    public static Map<String,Object> successMap(List data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(Map<String,Object> data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(Object data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(String msg,Integer code){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",code);
        return map;
    }

    public static Map<String,Object> successMap(String msg,List data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(String msg,Map<String,Object> data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(String msg,Object data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",SUCCESS_CODE);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(Integer code,List data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",code);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(Integer code,Map<String,Object> data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",SUCCESS_MSG);
        map.put("code",code);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(String msg,Integer code,List data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",code);
        map.put("data",data);
        return map;
    }

    public static Map<String,Object> successMap(String msg,Integer code,Map<String,Object> data){
        Map<String,Object> map = new HashMap<>();
        map.put("msg",msg);
        map.put("code",code);
        map.put("data",data);
        return map;
    }
}
